<?php
/**
 * Created by PhpStorm.
 * User: 64423
 * Date: 2018/10/24
 * Time: 15:06
 */

namespace app\shop\model;


use think\Model;

class BannerModel extends Model
{
    protected $table = 'dp_banner';
    protected $field = true;
    public static function getList()
    {
        return self::select();
    }

    public static function getOne($id)
    {
        return self::where('id', $id)->find();
    }

    public static function store($data, $id)
    {
        if($id == 0){
            return self::insert($data);
        }else{
            return self::where('id', $id)->update($data);
        }
    }
}